<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>无人机项目随机抽签系统</title>
  <style>
    body {
      font-family: 'Segoe UI', sans-serif;
      background-color: #f3f4f6;
      padding: 20px;
      line-height: 1.6;
    }
    h1 {
      color: #1f2937;
    }
    .section {
      margin-bottom: 30px;
    }
    button {
      background-color: #3b82f6;
      color: white;
      padding: 8px 16px;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      font-size: 1rem;
    }
    button:hover {
      background-color: #2563eb;
    }
    .result {
      margin-top: 10px;
      background: #fff;
      border-left: 4px solid #3b82f6;
      padding: 10px;
      border-radius: 4px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
  </style>
</head>
<body>
  <h1>无人机项目随机抽签系统</h1>

  <div class="section">
    <h2>物流运输平台A位置</h2>
    <button onclick="drawPlatformA()">抽取位置</button>
    <div id="platformA-result" class="result"></div>
  </div>

  <div class="section">
    <h2>物流运输平台B位置</h2>
    <button onclick="drawPlatformB()">抽取位置</button>
    <div id="platformB-result" class="result"></div>
  </div>

  <div class="section">
    <h2>物流运输平台高度</h2>
    <button onclick="drawPlatformHeight()">抽取高度</button>
    <div id="platformHeight-result" class="result"></div>
  </div>

  <div class="section">
    <h2>高空清障位置</h2>
    <button onclick="drawObstaclePos()">抽取位置</button>
    <div id="obstaclePos-result" class="result"></div>
  </div>

  <div class="section">
    <h2>高空清障高度</h2>
    <button onclick="drawObstacleHeight()">抽取高度</button>
    <div id="obstacleHeight-result" class="result"></div>
  </div>

  <div class="section">
    <h2>三维运动圈配置</h2>
    <button onclick="drawRingConfig()">抽取配置</button>
    <div id="ringConfig-result" class="result"></div>
  </div>

  <div class="section">
    <h2>空中侦测位置</h2>
    <button onclick="drawDetectionPos()">抽取位置</button>
    <div id="detection-result" class="result"></div>
  </div>

  <script>
    function randomPick(arr, count = 1) {
      const copy = [...arr];
      const res = [];
      while (res.length < count && copy.length) {
        const idx = Math.floor(Math.random() * copy.length);
        res.push(copy.splice(idx, 1)[0]);
      }
      return res;
    }

    function drawPlatformA() {
      const options = ["A1", "A2", "B1", "B2"];
      document.getElementById("platformA-result").innerText = `位置：${randomPick(options)[0]}`;
    }

    function drawPlatformB() {
      const options = ["E5", "E6", "F5", "F6"];
      document.getElementById("platformB-result").innerText = `位置：${randomPick(options)[0]}`;
    }

    function drawPlatformHeight() {
      const options = ["80", "90", "100"];
      document.getElementById("platformHeight-result").innerText = `高度：${randomPick(options)[0]}cm`;
    }

    function drawObstaclePos() {
      const options = ["左横", "左竖", "中横", "中竖", "右横", "右竖"];
      document.getElementById("obstaclePos-result").innerText = `位置：${randomPick(options)[0]}`;
    }

    function drawObstacleHeight() {
      const options = ["60", "70", "80", "90"];
      document.getElementById("obstacleHeight-result").innerText = `高度：${randomPick(options)[0]}cm`;
    }

    function drawRingConfig() {
      const diameters = ["50", "60", "70"];
      const directions = ["90度", "180度"];
      const heights = ["70", "80", "90", "100", "110", "120"];

      const result = `圈径：${randomPick(diameters)[0]}cm，方向：${randomPick(directions)[0]}，高度：${randomPick(heights)[0]}cm`;
      document.getElementById("ringConfig-result").innerText = result;
    }

    function drawDetectionPos() {
      const options = ["E1", "E2", "E3", "E4", "F1", "F2", "F3", "F4"];
      document.getElementById("detection-result").innerText = `位置：${randomPick(options)[0]}`;
    }
  </script>
</body>
</html>